﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ICollectionComparer.cs" company="" />
// <summary>
//   The interface defining a collection comparer.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Utilities
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The interface defining a collection comparer.
    /// </summary>
    /// <typeparam name="TKey">The type of the key used for identifying comparable elements.</typeparam>
    /// <typeparam name="TElement">The type of the elements in the compared collections.</typeparam>
    public interface ICollectionComparer<TKey, TElement>
        where TElement : IEquatable<TElement>
    {
        /// <summary>
        /// Gets the enumeration of elements residing only in the original collection (from, left hand side).
        /// </summary>
        IReadOnlyDictionary<TKey, TElement> OnlyOriginal { get; }

        /// <summary>
        /// Gets the enumeration of elements residing only in the target collection (to, right hand side).
        /// </summary>
        IReadOnlyDictionary<TKey, TElement> OnlyTarget { get; }

        /// <summary>
        /// Gets the enumeration of differences between similar elements (having the same key).
        /// The item returned by the enumerable contains the keys of the similar elements.
        /// </summary>
        IReadOnlyDictionary<TKey, Tuple<TElement, TElement>> Differences { get; }
    }
}
